/*
 * Copyright (c) 2018. paascloud.net All Rights Reserved.
 * 项目名称：paascloud快速搭建企业级分布式微服务平台
 * 类名称：UacRoleActionService.java
 * 创建人：刘兆明
 * 联系方式：paascloud.net@gmail.com
 * 开源地址: https://github.com/paascloud
 * 博客地址: http://blog.paascloud.net
 * 项目官网: http://paascloud.net
 */

package com.csun.cmny.provider.service;


import com.csun.cmny.core.support.IService;
import com.csun.cmny.provider.model.domain.UacAction;
import com.csun.cmny.provider.model.domain.UacRoleAction;
import com.csun.cmny.provider.model.domain.UacRoleMenu;
import com.csun.cmny.provider.model.dto.group.GroupRoleDto;
import com.csun.cmny.provider.model.dto.role.RoleAssignActionDto;

import java.util.ArrayList;
import java.util.List;
import java.util.Set;

/**
 * The interface Uac role action service.
 *
 * @author paascloud.net @gmail.com
 */
public interface UacRoleActionService extends IService<UacRoleAction> {
	/**
	 * List by role id list.
	 *
	 * @param roleId the role id
	 *
	 * @return the list
	 */
	List<UacRoleAction> listByRoleId(Long roleId);

	/**
	 * Delete by role id.
	 *
	 * @param roleId the role id
	 */
	void deleteByRoleId(Long roleId);

	/**
	 * Insert.
	 *
	 * @param roleId       the role id
	 * @param actionIdList the action id list
	 */
	void insert(Long roleId, Set<Long> actionIdList);

	/**
	 * Delete by role id list int.
	 *
	 * @param roleIdList the role id list
	 *
	 * @return the int
	 */
	int deleteByRoleIdList(List<Long> roleIdList);

	/**
	 * 批量删除角色功能
	 *
	 * @param roleId		角色Id
	 * @param actionIdList	功能Id列表
	 *
	 * @return	影响的行数
	 */
    Integer batchDelete(Long roleId, List<Long> actionIdList);

	/**
	 * 批量添加角色功能
	 *
	 * @param roleId		角色Id
	 * @param actionIdList	功能Id列表
	 *
	 * @return	影响的行数
	 */
    Integer batchSave(Long roleId, List<Long> actionIdList);

    /**
     * get check role list by action id
     *
     * @param actionId  the action id
     *
     * @return  the role id list
     */
    List<Long> getCheckRoleList(Long actionId);

    /**
     * batch save action and role list
     *
     * @param actionId      action id
     * @param checkRoleList check role list
     *
     * @return  the int.
     */
    Integer batchSaveActionAndRoleList(Long actionId, List<Long> checkRoleList);

    /**
     * batch delete action and role list
     *
     * @param actionId          the action id
     * @param deleteRoleList    the delete role list
     *
     * @return  the int.
     */
    Integer batchDeleteActionAndRoleList(Long actionId, List<Long> deleteRoleList);

	/**
	 * query list by role id list
	 *
	 * @param roleIdList	the role id list
	 *
	 * @return	the list.
	 */
	List<UacRoleAction> queryListByRoleIdList(List<Long> roleIdList);

	/**
	 * 查询功能列表
	 *
	 * @param groupRoleDto	the group role dto
	 *
	 * @return	the list.
	 */
    List<UacAction> queryRoleActionList(GroupRoleDto groupRoleDto);

	/**
	 * 查询功能列表 - 包含角色选中功能状态
	 *
	 * @param groupRoleDto	the group role dto
	 *
	 * @return	the list.
	 */
	List<UacAction> queryRoleActionListWithCheck(GroupRoleDto groupRoleDto);
}
